package com.logicwin.aibala.model.androidSWInfo;

import com.logicwin.aibala.system.sqlite.SQLiteService;

import android.content.pm.PackageInfo;

/**
 * 描述手机上通过Aibala安装的软件信息
 * 
 * @author GuoDing
 *
 */
public class APKInstallInfo {
	
	public static final int INSTALL_STAT_NO_INSTALL = 1;    //没有安装
	public static final int INSTALL_STAT_HAS_INSTALL = 2;   //已经安装，并且没有更新
	public static final int INSTALL_STAT_NEED_UPDATE = 3;   //已经安装，并且有更新
	
	private boolean isAibala = false;
	private int swID = -1;
	private String currVersion;
	private String packageName = "";
	private String apkName = "";
	
	public APKInstallInfo(PackageInfo pi) {
		this.packageName = new String(pi.packageName);
		this.apkName = new String(pi.applicationInfo.name);
		this.currVersion = new String(pi.versionName);
		this.swID = SQLiteService.containAPK(this.packageName);
		this.isAibala = (0 <= this.swID);
	}
	
	public boolean isAibala() {
		return this.isAibala;
	}
	
	public int getSWID() {
		return this.swID;
	}
	
	public String getCurrVersion() {
		return this.currVersion;
	}

	public String getAPKName() {
		return this.apkName;
	}
	
	public String getPackageName() {
		return this.packageName;
	}
}
